inherited dm_involucro: Tdm_involucro
  OldCreateOrder = True
  Left = 339
  Top = 224
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '  i.COD_INVOLUCRO,'
      '  i.LIG_COD_INVOLUVRO_TIPO,'
      '  i.LIG_COD_PRODUTO,'
      '  i.LIG_COD_CLASS_TERAPEUTICA,'
      '  i.SITUACAO,'
      '  case'
      '    when i.SITUACAO = '#39'True'#39'  then '#39'ATIVO'#39
      '    when i.SITUACAO = '#39'false'#39' then '#39'INATIVO'#39
      '  end as SITUACAO_DESC,'
      '  i.TAMANHO,'
      '  coalesce(i.VOLUME_INT_MAX,0) as VOLUME_INT_MAX,'
      '  coalesce(i.VOLUME_EXTERNO,0) as VOLUME_EXTERNO,'
      '  coalesce(i.PESO_VAZIO,0) as PESO_VAZIO,'
      '  i.PRIORIDADE,'
      '  i.DATA_CAD,'
      '  i.DATA_ALTERACAO,'
      '  t.descricao as involucro_tipo,'
      '  ct.descricao as class_terapeutica,'
      '  p.descricao ||'#39'/'#39'|| p.apresentacao as produto,'
      '  c1.descricao as cor_01,'
      '  c2.descricao as cor_02'
      'from F_INVOLUCRO i'
      
        'left join f_involucro_tipo t on (t.cod_involucro_tipo = i.lig_co' +
        'd_involuvro_tipo)'
      
        'left join f_classificacao_terapeutica ct on (ct.cod_classificaca' +
        'o = i.lig_cod_class_terapeutica)'
      'left join produto p on (p.cod_produto = i.lig_cod_produto)'
      'left join cor c1 on (c1.cod_cor = i.lig_cod_cor_01)'
      'left join cor c2 on (c2.cod_cor = i.lig_cod_cor_02)')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_INVOLUCRO: TIntegerField
      FieldName = 'COD_INVOLUCRO'
      Required = True
    end
    object cdsConsultaLIG_COD_INVOLUVRO_TIPO: TIntegerField
      FieldName = 'LIG_COD_INVOLUVRO_TIPO'
      Required = True
    end
    object cdsConsultaLIG_COD_PRODUTO: TIntegerField
      FieldName = 'LIG_COD_PRODUTO'
      Required = True
    end
    object cdsConsultaLIG_COD_CLASS_TERAPEUTICA: TIntegerField
      FieldName = 'LIG_COD_CLASS_TERAPEUTICA'
      Required = True
    end
    object cdsConsultaSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Required = True
      Size = 5
    end
    object cdsConsultaSITUACAO_DESC: TStringField
      FieldName = 'SITUACAO_DESC'
      FixedChar = True
      Size = 7
    end
    object cdsConsultaTAMANHO: TStringField
      FieldName = 'TAMANHO'
      Size = 5
    end
    object cdsConsultaVOLUME_INT_MAX: TFMTBCDField
      FieldName = 'VOLUME_INT_MAX'
      Precision = 15
      Size = 3
    end
    object cdsConsultaVOLUME_EXTERNO: TFMTBCDField
      FieldName = 'VOLUME_EXTERNO'
      Precision = 15
      Size = 3
    end
    object cdsConsultaPESO_VAZIO: TFMTBCDField
      FieldName = 'PESO_VAZIO'
      Precision = 15
      Size = 3
    end
    object cdsConsultaPRIORIDADE: TIntegerField
      FieldName = 'PRIORIDADE'
    end
    object cdsConsultaDATA_CAD: TDateField
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaINVOLUCRO_TIPO: TStringField
      FieldName = 'INVOLUCRO_TIPO'
      Size = 100
    end
    object cdsConsultaCLASS_TERAPEUTICA: TStringField
      FieldName = 'CLASS_TERAPEUTICA'
      Size = 100
    end
    object cdsConsultaCOR_01: TStringField
      FieldName = 'COR_01'
      Size = 100
    end
    object cdsConsultaCOR_02: TStringField
      FieldName = 'COR_02'
      Size = 100
    end
    object cdsConsultaPRODUTO: TStringField
      FieldName = 'PRODUTO'
      Size = 201
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_f_involucro,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    OnReconcileError = cdsRegistroReconcileError
    object cdsRegistroCOD_INVOLUCRO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_INVOLUCRO'
      Required = True
    end
    object cdsRegistroLIG_COD_PRODUTO: TIntegerField
      Alignment = taCenter
      FieldName = 'LIG_COD_PRODUTO'
      Required = True
    end
    object cdsRegistroLIG_COD_INVOLUVRO_TIPO: TIntegerField
      Alignment = taCenter
      FieldName = 'LIG_COD_INVOLUVRO_TIPO'
      Required = True
    end
    object cdsRegistroLIG_COD_CLASS_TERAPEUTICA: TIntegerField
      Alignment = taCenter
      FieldName = 'LIG_COD_CLASS_TERAPEUTICA'
      Required = True
    end
    object cdsRegistroLIG_COD_COR_01: TIntegerField
      FieldName = 'LIG_COD_COR_01'
      Required = True
    end
    object cdsRegistroLIG_COD_COR_02: TIntegerField
      FieldName = 'LIG_COD_COR_02'
      Required = True
    end
    object cdsRegistroSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Required = True
      Size = 5
    end
    object cdsRegistroTAMANHO: TStringField
      Alignment = taCenter
      FieldName = 'TAMANHO'
      Size = 5
    end
    object cdsRegistroVOLUME_INT_MAX: TFMTBCDField
      Alignment = taCenter
      FieldName = 'VOLUME_INT_MAX'
      Precision = 15
      Size = 3
    end
    object cdsRegistroVOLUME_EXTERNO: TFMTBCDField
      Alignment = taCenter
      FieldName = 'VOLUME_EXTERNO'
      Precision = 15
      Size = 3
    end
    object cdsRegistroPESO_VAZIO: TFMTBCDField
      Alignment = taCenter
      FieldName = 'PESO_VAZIO'
      Precision = 15
      Size = 3
    end
    object cdsRegistroPRIORIDADE: TIntegerField
      Alignment = taCenter
      FieldName = 'PRIORIDADE'
    end
    object cdsRegistroDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'codigo'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '    i.COD_INVOLUCRO,'
      '    i.LIG_COD_PRODUTO,'
      '    i.LIG_COD_INVOLUVRO_TIPO,'
      '    i.LIG_COD_CLASS_TERAPEUTICA,'
      '    i.LIG_COD_COR_01,'
      '    i.LIG_COD_COR_02,'
      '    i.SITUACAO,'
      '    i.TAMANHO,'
      '    i.VOLUME_INT_MAX,'
      '    i.VOLUME_EXTERNO,'
      '    i.PESO_VAZIO,'
      '    i.PRIORIDADE,'
      '    i.DATA_CAD,'
      '    i.DATA_ALTERACAO'
      'from F_INVOLUCRO i'
      'where i.cod_involucro = :codigo')
  end
  object sqlConsultaSituacao: TSQLQuery
    MaxBlobSize = -1
    Params = <>
    SQL.Strings = (
      'select distinct'
      
        '    (select count(a.cod_involucro) from f_involucro a where a.si' +
        'tuacao = '#39'True'#39') as Ativo,'
      
        '    (select count(b.cod_involucro) from f_involucro b where b.si' +
        'tuacao = '#39'False'#39') as Inativo'
      'from f_involucro i')
    SQLConnection = dmGeral.SQLConnectionBD
    Left = 323
    Top = 18
    object sqlConsultaSituacaoATIVO: TIntegerField
      FieldName = 'ATIVO'
    end
    object sqlConsultaSituacaoINATIVO: TIntegerField
      FieldName = 'INATIVO'
    end
  end
  object sqlCor: TSQLQuery
    MaxBlobSize = -1
    Params = <>
    SQL.Strings = (
      'select'
      '    cor.cod_cor,'
      '    cor.descricao'
      'from cor'
      'order by cor.descricao')
    SQLConnection = dmGeral.SQLConnectionBD
    Left = 241
    Top = 18
  end
  object dspCor: TDataSetProvider
    DataSet = sqlCor
    Left = 241
    Top = 66
  end
  object cdsCor: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspCor'
    Left = 241
    Top = 114
    object cdsCorCOD_COR: TIntegerField
      FieldName = 'COD_COR'
      Required = True
    end
    object cdsCorDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
  end
end
